import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/login',
            name: '登录',
            component: () => import("@/views/login/index.vue")
        },
        {
            path: '/',
            name: '主页',
            component: () => import("@/layout/index.vue"),
            redirect: "/chat",
            children: [
                {
                    path: "chat",
                    name: "对话",
                    component: () => import('@/views/home/page/chat/index.vue')
                },
                {
                    path: "function",
                    component: () => import('@/layout/function.vue'),
                    children: [
                        {
                            path: "updateLog",
                            name: "更新日志",
                            component: () => import('@/views/home/page/updateLog/index.vue'),
                        },
                        {
                            path: "treasure",
                            name: "百宝箱",
                            component: () => import('@/views/home/page/treasure/index.vue')
                        },
                        {
                            path: "resource",
                            name: "资源库",
                            component: () => import('@/views/home/page/resource/index.vue')
                        },
                        {
                            path: "limitLog",
                            name: "额度记录",
                            component: () => import('@/views/home/page/limitLog/index.vue')
                        },
                        {
                            path: "limitConfig",
                            name: "额度管理",
                            component: () => import('@/views/home/page/limitConfig/index.vue')
                        }
                    ]
                },
                {
                    path: "userSetting",
                    name: "个人设置",
                    component: () => import('@/views/home/page/userSetting/index.vue')
                },
                {
                    path: "menu",
                    name: "菜单管理",
                    redirect: "/",
                    children: [
                        {
                            path: "ai",
                            name: "AI对话",
                            redirect: "/"
                        },
                        {
                            path: "contract",
                            name: "合同审查",
                            component: () => import('@/views/home/page/contract/index.vue')
                        }

                    ]
                }
            ]
        }
    ],
})

export default router
